import Vue from 'vue'
import App from './App.vue'
import store from './store'
import util from './common/util.js'
import appjs from './app.js'
import API from '@/common/api.js';
import historicalRecord from '@/data/historicalRecord.js';


Vue.prototype.$root=util.root
Vue.prototype.$get=util.get
Vue.prototype.$prePage=util.prePage
Vue.prototype.$msg=util.msg
Vue.prototype.$jump=util.jump
Vue.prototype.$isLogin=util.isLogin

Vue.prototype.$store=store
Vue.prototype.$API=API
Vue.prototype.$appjs=appjs
Vue.prototype.$historicalRecord=historicalRecord

// 开放重置全局消息监听
	appjs.jim.onMsgReceive(function(data) {
		uni.vibrateLong();
		
		const innerAudioContext = uni.createInnerAudioContext();
		innerAudioContext.autoplay = true;
		innerAudioContext.src = '/static/thebell/dingding.mp3';
		innerAudioContext.onPlay(() => {
		  console.log('开始播放');
		});
		innerAudioContext.onError((res) => {
		  console.log(res.errMsg);
		  console.log(res.errCode);
		});
		
		console.log(data,"onMsgReceive")
	});
	
Vue.config.productionTip = false

App.mpType = 'app'

const app = new Vue({
    ...App
})
app.$mount()
